package com.eastcom.providor;


import java.io.File;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

public class BMSetting {
	
	public static String host;
	
	public static int port;
	
	public static int receivePort;
	
	public static String dataCollectorHost;
	
	public static int dataCollectorPort;
	
	public static int DEFAULTRMIPORT= 985;
	
	private static int refreshClentTime=60*60*1000;
	
	public static String DEFAULTRMIBINDNAME="BusinessManager";
	
	private static int RMIport;
	
	private static String RMIBindName;
	
	private static Logger BMlog; 
	
	public static File hibernateCfg;
	
	public static File SQMHibernateCfg;
	
	public BMSetting(String configfile,String appName){
		
		try{
			DOMConfigurator.configure(configfile);
			BMlog = Logger.getLogger(appName);
			
		}catch (Exception e) {
			BMlog = Logger.getRootLogger();
			e.printStackTrace();
		}
	}
	
	public BMSetting(Logger logger){
		BMlog=logger;
	}

	public  void setRMIPort(int RMIport) {
		BMSetting.RMIport = RMIport;
	}
	
	public void setRMIBindName(String bindName) {
		RMIBindName = bindName;
	}
	
	public static String getRMIBindName() {
		return RMIBindName;
	}

	public static Logger getBMlog() {
		return BMlog;
	}

	public static int getRMIPort() {
		return RMIport;
	}

	public static int getRefreshClentTime() {
		return refreshClentTime;
	}

	static void setRefreshClentTime(int refreshClentTime) {
		BMSetting.refreshClentTime = refreshClentTime;
	}
	
	

}
